/**
 * ResourceType.java
 * 
 * Copyright@2015 OVT Inc. All rights reserved. 
 * 
 * Dec 29, 2015
 */
package com.ovt.doorbell.payment.dao.constant;

/**
 * ResourceType
 * 
 * @Author zhi.liu
 * @Version 1.0
 * @See 
 * @Since [OVT Cloud Platform]/[API] 1.0
 */
public enum ResourceType
{

    SPACE, FLOW;
    
    public static ResourceType getResourceType(String type)
    {
        if(type == null)
        {
            return null;
        }
        
        if("space".equals(type.toLowerCase()))
        {
            return SPACE;
        }
        else if("flow".equals(type.toLowerCase()))
        {
            return FLOW;
        }
        
        return null;
    }
    
    public static String getTypeString(ResourceType type)
    {
        if(type == null)
        {
            return "";
        }
        if(type == SPACE)
        {
            return "Space";
        }
        else if(type == FLOW)
        {
            return "Flow";
        }
        
        return null;
    }
}
